﻿using LowCoding.Application.Sys.Role;
using LowCoding.Common;
using LowCoding.Dto.Sys;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace LowCoding.API.Controllers.sys.Role
{
    /// <summary>
    /// 用户添加角色API
    /// </summary>
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class SysUserroleController : BaseController
    {
        private readonly ISysUserroleService _sysUserroleService;

        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="sysroleservice"></param>
        /// <param name="syscompanyservice"></param>
        public SysUserroleController(ISysUserroleService sysUserroleService)
        {
            _sysUserroleService = sysUserroleService;
        }
        /// <summary>
        /// 用户添加角色信息（接口可用）
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost("Insert")]
        [AllowAnonymous]
        public async Task<ResponseMessageModel> AddUserRoleAsync(SysUserroleInput input)
        {
            return Success(await _sysUserroleService.AddUserRoleAsync(input));
        }
    }
}
